﻿<%@ Page Title="" Language="C#" MasterPageFile="~/adminpanel.master" AutoEventWireup="true" CodeFile="User.aspx.cs" Inherits="Web_User" %>

<%@ Register assembly="DevExpress.Web.ASPxGridView.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">

    <dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" 
        ClientIDMode="AutoID" CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" 
        CssPostfix="BlackGlass" DataSourceID="SqlDataSource1" KeyFieldName="Use_ID" 
        Width="100%">
        <Columns>
            <dx:GridViewCommandColumn VisibleIndex="0">
                <EditButton Visible="True">
                </EditButton>
                <ClearFilterButton Visible="True">
                </ClearFilterButton>

                 </dx:GridViewCommandColumn>
                <dx:GridViewCommandColumn VisibleIndex="1">
                <NewButton Visible="True">
                </NewButton>
                 </dx:GridViewCommandColumn>
                <dx:GridViewCommandColumn VisibleIndex="2">
                <DeleteButton Visible="True">
                </DeleteButton>
            </dx:GridViewCommandColumn>
            <dx:GridViewDataTextColumn Caption="User ID" FieldName="Use_ID" 
                VisibleIndex="3">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataComboBoxColumn FieldName="Use_Type" VisibleIndex="4" 
                Caption="User Type">
                <PropertiesComboBox ValueType="System.String">
                    <Items>
                        <dx:ListEditItem Text="Admin" Value="admin" />
                        <dx:ListEditItem Text="Super User" Value="superuser" />
                        <dx:ListEditItem Text="User" Value="user" />
                        <dx:ListEditItem Text="Viewer" Value="viewer" />
                        <dx:ListEditItem Text="Store" Value="storekeeper" />
                    </Items>
                    <ValidationSettings>
                        <RequiredField ErrorText="Please Select User Type" IsRequired="True" />
                    </ValidationSettings>
                </PropertiesComboBox>
            </dx:GridViewDataComboBoxColumn>
            <dx:GridViewDataTextColumn FieldName="Use_Name" VisibleIndex="5" Caption="User Name" 
                >
           
                    
                
                <PropertiesTextEdit>
                    <ValidationSettings>
                        <RequiredField ErrorText="Please Enter User Name" IsRequired="True" />
                    </ValidationSettings>
                </PropertiesTextEdit>
           
                    
                
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Pas_Word" VisibleIndex="6" 
                Caption="Password">
                <PropertiesTextEdit Password="True">
                    <ValidationSettings>
                        <RequiredField ErrorText="Please Enter Password" IsRequired="True" />
                    </ValidationSettings>
                </PropertiesTextEdit>
            </dx:GridViewDataTextColumn>
        </Columns>
        <SettingsBehavior ConfirmDelete="True" />
        <SettingsPager PageSize="25">
        </SettingsPager>
        <Settings ShowFilterRow="True" />
        <Images SpriteCssFilePath="~/App_Themes/BlackGlass/{0}/sprite.css">
            <LoadingPanelOnStatusBar Url="~/App_Themes/BlackGlass/GridView/gvLoadingOnStatusBar.gif">
            </LoadingPanelOnStatusBar>
            <LoadingPanel Url="~/App_Themes/BlackGlass/GridView/Loading.gif">
            </LoadingPanel>
        </Images>
        <ImagesFilterControl>
            <LoadingPanel Url="~/App_Themes/BlackGlass/Editors/Loading.gif">
            </LoadingPanel>
        </ImagesFilterControl>
        <Styles CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" 
            CssPostfix="BlackGlass">
            <Header ImageSpacing="5px" SortingImageSpacing="5px">
            </Header>
        </Styles>
        <StylesEditors>
            <CalendarHeader Spacing="1px">
            </CalendarHeader>
            <ProgressBar Height="25px">
            </ProgressBar>
        </StylesEditors>
    </dx:ASPxGridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BestlifeDBConnectionString %>" 
        DeleteCommand="DELETE FROM [Tbl_Admin_User] WHERE [Use_ID] = @Use_ID" 
        InsertCommand="INSERT INTO [Tbl_Admin_User] ([Use_ID], [Use_Type], [Use_Name], [Pas_Word]) VALUES (@Use_ID, @Use_Type, @Use_Name, @Pas_Word)" 
        SelectCommand="SELECT [Use_ID], [Use_Type], [Use_Name], [Pas_Word] FROM [Tbl_Admin_User]" 
        
        UpdateCommand="UPDATE [Tbl_Admin_User] SET [Use_Type] = @Use_Type, [Use_Name] = @Use_Name, [Pas_Word] = @Pas_Word WHERE [Use_ID] = @Use_ID">
        <DeleteParameters>
            <asp:Parameter Name="Use_ID" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Use_ID" Type="String" />
            <asp:Parameter Name="Use_Type" Type="String" />
            <asp:Parameter Name="Use_Name" Type="String" />
            <asp:Parameter Name="Pas_Word" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="Use_ID" Type="String" />
            <asp:Parameter Name="Use_Type" Type="String" />
            <asp:Parameter Name="Pas_Word" Type="String" />
            <asp:Parameter Name="Use_Name" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
     <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BestlifeDBConnectionString %>" 
        SelectCommand="SELECT Dis_ID FROM Tbl_Distributor" 
        
        >
        
        </asp:SqlDataSource>


    
</asp:Content>

